<?php 
require_once("../includes/config.php");
  if ($_SESSION["r"]>1)
  {
  	$_SESSION['error_message'] = "غير مسموح";
	redirect("index.php");
	die();
  }
if($_SERVER["REQUEST_METHOD"] == "POST"){
$date = date("Y-m-d h:i:s");
$SQL=query("INSERT INTO payment_vouchers (type,pay_to,payment_type,recipient,amount,paymen_method,paymen_item,toward,
            notes,date,Hijri_date,owner_id,user_id,created_at) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)",$_POST['type'],$_POST['pay_to'],$_POST['payment_type'],$_POST['recipient'],$_POST['amount'],
			$_POST['paymen_method'],$_POST['paymen_item'],$_POST['toward'],$_POST['notes'],$_POST['hijri_date'],$_POST['date'],$_SESSION['user_id'],$_SESSION['id'],$date);

  redirect("payment_vouchers.php");
}
 
?>